/* 
 * Selling Partner API for Sellers
 *
 * The Selling Partner API for Sellers lets you retrieve information on behalf of sellers about their seller account, such as the marketplaces they participate in. Along with listing the marketplaces that a seller can sell in, the API also provides additional information about the marketplace such as the default language and the default currency. The API also provides seller-specific information such as whether the seller has suspended listings in that marketplace.
 *
 * OpenAPI spec version: v1
 * 
 * Generated by: https://github.com/swagger-api/swagger-codegen.git
 */

using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.IO;
using System.Runtime.Serialization;
using System.Text;

namespace FikaAmazonAPI.AmazonSpApiSDK.Models.Sellers
{
    /// <summary>
    /// Detailed information that is specific to a seller in a Marketplace.
    /// </summary>
    [DataContract]
    public partial class Participation : IEquatable<Participation>, IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="Participation" /> class.
        /// </summary>
        [JsonConstructorAttribute]
        public Participation() { }
        /// <summary>
        /// Initializes a new instance of the <see cref="Participation" /> class.
        /// </summary>
        /// <param name="IsParticipating">IsParticipating (required).</param>
        /// <param name="HasSuspendedListings">Specifies if the seller has suspended listings. True if the seller Listing Status is set to Inactive, otherwise False. (required).</param>
        public Participation(bool? IsParticipating = default(bool?), bool? HasSuspendedListings = default(bool?))
        {
            // to ensure "IsParticipating" is required (not null)
            if (IsParticipating == null)
            {
                throw new InvalidDataException("IsParticipating is a required property for Participation and cannot be null");
            }
            else
            {
                this.IsParticipating = IsParticipating;
            }
            // to ensure "HasSuspendedListings" is required (not null)
            if (HasSuspendedListings == null)
            {
                throw new InvalidDataException("HasSuspendedListings is a required property for Participation and cannot be null");
            }
            else
            {
                this.HasSuspendedListings = HasSuspendedListings;
            }
        }

        /// <summary>
        /// Gets or Sets IsParticipating
        /// </summary>
        [DataMember(Name = "isParticipating", EmitDefaultValue = false)]
        public bool? IsParticipating { get; set; }

        /// <summary>
        /// Specifies if the seller has suspended listings. True if the seller Listing Status is set to Inactive, otherwise False.
        /// </summary>
        /// <value>Specifies if the seller has suspended listings. True if the seller Listing Status is set to Inactive, otherwise False.</value>
        [DataMember(Name = "hasSuspendedListings", EmitDefaultValue = false)]
        public bool? HasSuspendedListings { get; set; }

        /// <summary>
        /// Returns the string presentation of the object
        /// </summary>
        /// <returns>String presentation of the object</returns>
        public override string ToString()
        {
            var sb = new StringBuilder();
            sb.Append("class Participation {\n");
            sb.Append("  IsParticipating: ").Append(IsParticipating).Append("\n");
            sb.Append("  HasSuspendedListings: ").Append(HasSuspendedListings).Append("\n");
            sb.Append("}\n");
            return sb.ToString();
        }

        /// <summary>
        /// Returns the JSON string presentation of the object
        /// </summary>
        /// <returns>JSON string presentation of the object</returns>
        public string ToJson()
        {
            return JsonConvert.SerializeObject(this, Formatting.Indented);
        }

        /// <summary>
        /// Returns true if objects are equal
        /// </summary>
        /// <param name="input">Object to be compared</param>
        /// <returns>Boolean</returns>
        public override bool Equals(object input)
        {
            return this.Equals(input as Participation);
        }

        /// <summary>
        /// Returns true if Participation instances are equal
        /// </summary>
        /// <param name="input">Instance of Participation to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Participation input)
        {
            if (input == null)
                return false;

            return
                (
                    this.IsParticipating == input.IsParticipating ||
                    (this.IsParticipating != null &&
                    this.IsParticipating.Equals(input.IsParticipating))
                ) &&
                (
                    this.HasSuspendedListings == input.HasSuspendedListings ||
                    (this.HasSuspendedListings != null &&
                    this.HasSuspendedListings.Equals(input.HasSuspendedListings))
                );
        }

        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hashCode = 41;
                if (this.IsParticipating != null)
                    hashCode = hashCode * 59 + this.IsParticipating.GetHashCode();
                if (this.HasSuspendedListings != null)
                    hashCode = hashCode * 59 + this.HasSuspendedListings.GetHashCode();
                return hashCode;
            }
        }

        /// <summary>
        /// To validate all properties of the instance
        /// </summary>
        /// <param name="validationContext">Validation context</param>
        /// <returns>Validation Result</returns>
        IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
        {
            yield break;
        }
    }

}
